package com.wf.course.service.impl;

import com.utils.page.PageBean;
import com.wf.course.dao.ICourseShareMapper;
import com.wf.course.model.course.CourseShare;
import com.wf.course.service.ICourseShareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(rollbackFor = Exception.class)
public class ICourseShareServiceImpl implements ICourseShareService {

    @Autowired
    private ICourseShareMapper courseShareMapper;

    @Override
    public void list(PageBean<CourseShare> pageBean) {
        pageBean.setResults(courseShareMapper.list(pageBean));
        pageBean.setTotalCount(courseShareMapper.count(pageBean));
    }

    @Override
    public CourseShare queryCourseShareById(Integer id) {
        return courseShareMapper.queryCourseShareById(id);
    }

    @Override
    public Integer deleteCourseShareById(Integer id) {
        return courseShareMapper.deleteCourseShareById(id);
    }

    @Override
    public Integer insert(CourseShare courseShare) {
        return courseShareMapper.insert(courseShare);
    }

    @Override
    public Integer update(CourseShare courseShare) {
        return courseShareMapper.update(courseShare);
    }
}
